package com.ruoyi.ufox.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ufox.mapper.SysHolidaySettingMapper;
import com.ruoyi.ufox.domain.SysHolidaySetting;
import com.ruoyi.ufox.service.ISysHolidaySettingService;

/**
 * 假日模板Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-08-31
 */
@Service
public class SysHolidaySettingServiceImpl implements ISysHolidaySettingService 
{
    @Autowired
    private SysHolidaySettingMapper sysHolidaySettingMapper;

    /**
     * 查询假日模板
     * 
     * @param settingId 假日模板主键
     * @return 假日模板
     */
    @Override
    public SysHolidaySetting selectSysHolidaySettingBySettingId(Long settingId)
    {
        return sysHolidaySettingMapper.selectSysHolidaySettingBySettingId(settingId);
    }

    /**
     * 查询假日模板列表
     * 
     * @param sysHolidaySetting 假日模板
     * @return 假日模板
     */
    @Override
    public List<SysHolidaySetting> selectSysHolidaySettingList(SysHolidaySetting sysHolidaySetting)
    {
        return sysHolidaySettingMapper.selectSysHolidaySettingList(sysHolidaySetting);
    }

    /**
     * 新增假日模板
     * 
     * @param sysHolidaySetting 假日模板
     * @return 结果
     */
    @Override
    public int insertSysHolidaySetting(SysHolidaySetting sysHolidaySetting)
    {
        sysHolidaySetting.setCreateTime(DateUtils.getNowDate());
        return sysHolidaySettingMapper.insertSysHolidaySetting(sysHolidaySetting);
    }

    /**
     * 修改假日模板
     * 
     * @param sysHolidaySetting 假日模板
     * @return 结果
     */
    @Override
    public int updateSysHolidaySetting(SysHolidaySetting sysHolidaySetting)
    {
        sysHolidaySetting.setUpdateTime(DateUtils.getNowDate());
        return sysHolidaySettingMapper.updateSysHolidaySetting(sysHolidaySetting);
    }

    /**
     * 批量删除假日模板
     * 
     * @param settingIds 需要删除的假日模板主键
     * @return 结果
     */
    @Override
    public int deleteSysHolidaySettingBySettingIds(Long[] settingIds)
    {
        return sysHolidaySettingMapper.deleteSysHolidaySettingBySettingIds(settingIds);
    }

    /**
     * 删除假日模板信息
     * 
     * @param settingId 假日模板主键
     * @return 结果
     */
    @Override
    public int deleteSysHolidaySettingBySettingId(Long settingId)
    {
        return sysHolidaySettingMapper.deleteSysHolidaySettingBySettingId(settingId);
    }
}
